class WebSocketResult {
  bool success;

  String message;

  Map data;

  WebSocketResult(this.success, this.message, this.data)
      : assert(data == null) {
    print(this.runtimeType.toString() + "propertity data is null");
  }

  //json
  WebSocketResult.fromJson(Map encode)
      : this.success = encode['success'],
        this.message = encode['message'],
        this.data = encode['data'];

  getDataIndex(int i) {
    return SocketMessage.fromJson(this.data[i]);
  }
}

class SocketMessage {
  String messageShowType;
  String messageType;
  String content;
  String key;
  String module;
  String title;
  String resourcePath;

  SocketMessage({this.messageShowType,this.messageType,this.module, this.content, this.title});

  SocketMessage.fromJson(Map map)
      : this.messageShowType = map['messageShowType'],
        this.messageType = map['messageType'],
        this.content = map['message'],
        this.key=map['message'],
        this.module=map['module'],
        this.resourcePath = map['resourcePath'],
        this.title = map['title'];
}
